Static composition of refactorings

نویسندگان

  • Günter Kniesel
  • Helge Koch
چکیده

The number of possible refactorings is unlimited, so no tool vendor will ever be able to provide custom refactorings for all specific user needs. Therefore, we propose a new kind of refactoring tools, which allow users to create, edit and and compose required refactorings just like any other documents. The heart of such a refactoring editor is the ability to compose larger refactorings from existing ones. Computing the precondition of the composite refactoring from the preconditions of the composed refactorings is non-trivial since earlier transformations influence the truth of preconditions of later ones. The ability to calculate these effects without referring to a particular program to which the refactorings should be applied is called program-independent composition. It is the prerequisite for creating composite refactorings that are reusable on arbitrary programs. The main contribution of this paper is a formal model for automatic, programindependent composition of conditional program transformations. We show that conditional transformations, including refactorings, can be composed from a limited set of basic operations. Program-independent derivation of a precondition for the composite is based on the notion of “transformation description”, which can be seen as a simplified, yet equally powerful, variant of Roberts’ “postconditions” [32]. Our approach simplifies the implementation of refactoring tools – only the basic operations and the ability for composition must be hard coded in a tool. As a proof of concept, we sketch a transformation framework that implements our approach (jConditioner) and, based on the framework, an experimental refactoring tool (ConTraCT) that includes the editing capabilities that motivated our work.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Composite Refactorings: The Next Refactoring Rubicons

The industry crossed the first refactoring rubicon, namely Extract Method, more than a decade ago. Today, all mainstream Integrated Development Environments (IDEs) support this refactoring, and empirical studies have shown that Extract Method is one of the most frequently used automated refactorings. Although complex refactorings are more tedious and error-prone, studies have shown that program...

متن کامل

Making Software Refactorings Safer

Refactorings often require that non-trivial semantic correctness conditions are met. IDEs such as Eclipse’s Java Development Tools rely on simpler, static precondition checks for refactorings. This leads to the phenomenon that a seemingly innocuous refactoring can change the behavior of the program. In this thesis we demonstrate our technique of introducing runtime checks of two particular refa...

متن کامل

Composite Refactorings for EMF Models

Models are primary artifacts in model-based, and especially, in model-driven software development processes. Due to their central role, the quality of models must be high to lead to software products of high quality. A common technique for improving the quality of software artifacts is refactoring. Originally developed for code structure improvement, the concept of refactoring has been raised t...

متن کامل

Safe Composition of Refactoring Feature Modules

Programs can be composed by successively applying transformations that add features to a code base. These transformations must apply without errors but we cannot test every combination of them. We must detect errors automatically to encapsulate single transformations and scale them. Prior work focused on transformations that monotonically add code in order to produce program variants. We genera...

متن کامل

A Static Semantics for Alloy and its Impact in Refactorings

Refactorings are usually proposed in an ad hoc way because it is difficult to prove that they are sound with respect to a formal semantics, not guaranteeing the absence of type errors or semantic changes. Consequently, developers using refactoring tools must rely on compilation and tests to ensure type-correctness and semantics preservation, respectively, which may not be satisfactory to critic...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Sci. Comput. Program.

دوره 52  شماره 

صفحات  -

تاریخ انتشار 2004